home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 1004 < prev    next >
Encoding:
Text File  |  1996-08-06  |  2.1 KB  |  60 lines

  1. Path: fido.asd.sgi.com!austern
  2. From: opetrova@blue.weeg.uiowa.edu (O. Petrova)
  3. Newsgroups: comp.lang.c++.moderated,comp.std.c++
  4. Subject: STL's operators template<>bool operator<(...) hurt!!!!!!!!!
  5. Date: 08 Apr 1996 10:15:32 PDT
  6. Organization: University of Iowa, Iowa City, IA, USA
  7. Approved: austern@isolde.mti.sgi.com
  8. Message-ID: <9604072103.AA09560@avs.cs.rpi.edu>
  9. NNTP-Posting-Host: isolde.mti.sgi.com
  10. X-Original-Date: 7 Apr 96 20:20:29 GMT
  11. X-Mailer: ELM [version 2.4 PL24]
  12. X-Auth: PGPMoose V1.1 PGP comp.std.c++
  13.     iQBVAwUBMWlJtUy4NqrwXLNJAQGeTQIAprDI7WmFIVjjfg0XJI6EhKWAsagUHR7P
  14.     Eyb6h+q4uELeUmVSucazioIm5QdRqJfha5dv0+FMBs1XjWCRCp9Lig==
  15.     =FftE
  16. Originator: austern@isolde.mti.sgi.com
  17.  
  18. [Moderator's note: please note that this article is crossposted to 
  19. comp.lang.c++.moderated and comp.std.c++, and that default followups
  20. have been set to comp.std.c++.  mha]
  21.  
  22. class EExpression
  23.     {
  24.     public:
  25.             EExpression( int );
  26.             EExpression( double );
  27.  
  28.     public:
  29.       friend EExpression  operator+( const EExpression&, const EExpression& );
  30.       friend EExpression  operator<( const EExpression&, const EExpression& );
  31.     .....
  32.     public:
  33.              string fSQLString;
  34.     };
  35.  
  36.  
  37. void main()
  38.     {
  39.    // Works fine w/o STL, doesn't with it
  40.    // because of template<class T> bool operator> in function.h
  41.    //                              ^^^^
  42.     EExpression a = EExpression( 2 ) > 4; 
  43.     ....
  44.     }
  45.  
  46. I don't like that at all. I think that those operators should be
  47. removed form STL.
  48.  
  49.       [ Articles to moderate: mailto:c++-submit@netlab.cs.rpi.edu ]
  50.       [  Read the C++ FAQ: http://www.connobj.com/cpp/cppfaq.htm  ]
  51.       [  Moderation policy: http://www.connobj.com/cpp/guide.htm  ]
  52.       [      Comments? mailto:c++-request@netlab.cs.rpi.edu       ]
  53. ---
  54. [ comp.std.c++ is moderated.  To submit articles: Try just posting with your 
  55.                 newsreader.  If that fails, use mailto:std-c++@ncar.ucar.edu
  56.   comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
  57.   Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
  58.   Comments? mailto:std-c++-request@ncar.ucar.edu 
  59. ]
  60.